-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infer a missing method as returning Union{}
#20866
Conversation
Derp. I really should get into the habit of enabling assertions. |
Huh, looks like |
55975e1
to
d985f2d
Compare
@vtjnash: Jeff wants your opinion on this, but is "generally in favor". |
As the author of this PR noted above, we can't do this until type-intersection is usually correct. |
OTOH, as long as type-intersection may give wrongly empty answers, things can easily break anyway; this PR only makes it even a little easier. Consider function foo(...)
# ...
end
function bar(...)
# ...
foo(...)
end Now if the inferred types for the arguments to foo(...) = error("arguments must ... whatever") with a signature more general than the first I guess what I'm trying to say is: We really need to make type-intersection reliable; this PR only increases the pressure to do so. |
In a way, making the process more likely to crash in cases where inference is wrong is helpful for finding cases where it is wrong. |
Superseded by #21892. |
Ref #20033 (comment) and 0b8f0b7#commitcomment-21033206.